namespace MusicManagerServiceRole.Migrations
{
    using MusicManagerServiceRole.Models;
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<MusicManagerServiceRole.Models.ApplicationDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(MusicManagerServiceRole.Models.ApplicationDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            context.MusicModels.AddOrUpdate(m => m.Title,
                new MusicModel
                {
                    Title = "Best Song",
                    Owner = "Me",
                    UploadDate = DateTime.Now,
                },
                new MusicModel
                {
                    Title = "Second Best Song",
                    Owner = "Me",
                    UploadDate = DateTime.Now,
                },
                new MusicModel
                {
                    Title = "Worst Song",
                    Owner = "You",
                    UploadDate = DateTime.Now,
                },
                new MusicModel
                {
                    Title = "Random Song",
                    Owner = "Random Guy",
                    UploadDate = DateTime.Now,
                }
                );
        }
    }
}
